﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using AutoReplace.Models;

namespace AutoReplace.Utils
{
    public static class Common
    {
        /// <summary>
        /// 检测路径是否为【文件】【文件夹】或【无效路径】
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static PathGenre CheckFileOrPath(string path)
        {
            if (Directory.Exists(path)) return  PathGenre.Directory;
            else
            {
                if (File.Exists(path)) return PathGenre.File;
                else return PathGenre.Invalid;
            }
        }
    }
}